CC = gcc
RM = rm -f
TARGET = run

WORKSPACE := $(shell cd .. && pwd)

CFLAGS := -Wall -O $(CFLAGS) -std=gnu99
CFLAGS += -I$(WORKSPACE)/worker -I$(WORKSPACE)/queue
LINK_LIBS = -lpthread

OBJS = main.o queue.o $(WORKSPACE)/worker/worker.o


ALL: $(TARGET)
	@echo $(WORKSPACE)
	@echo "Compile all"
	# ./$(TARGET)

$(TARGET): $(OBJS)
	$(CC) $^ -o $@ $(LINK_LIBS)

%.o : %.c
	@echo $(WORKSPACE)
	$(CC) $(CFLAGS) -c $< -o $@

clean:
	$(RM) $(OBJS) $(TARGET)

